{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<div>
	<form name="catform" action="__APP__/Course/mod_category_ok" method="post">
		<div>				
			<table id="mytab"  border="1" class="t1" width="100%">				
				<tr style="height:50px;">
					<th align="right">
						{$lang.cat_name}
					</th>
					<td>
						<span>
							<input type="text" class="input" name="name" value="{$catInfo.name}"/>					
						</span>
						<b class="lovingtips" title=""></b>
						<span class="redtext">{$lang.input_tips}</span>
					</td>
				</tr>
				<!-- 父分类 -->
				<tr style="height:50px;">
					<th align="right">
						{$Think.lang.sort_order}
					</th>
					<td>
						<select id="parent_id" name="parent_id" class="select" >
							<option value="0">顶级分类</option>
							<volist name="catList" id="cat">
								<option value="{$cat.id}">{$cat.name}</option>
							</volist>
						</select>
						<b class="lovingtips" title=""></b>
					</td>
				</tr>
				<tr style="height:50px;">
					<th align="right">
						排序
					</th>
					<td>
						<span>
							<input type="text" class="input" name="sort" value="{$catInfo.sort}"/>					
						</span>
						<b class="lovingtips" title=""></b>
						<span class="redtext">只能填写数字</span>
					</td>
				</tr>
				<tr style="height:50px;">
					<th align="right">
						{$lang.is_show}
					</th>
					<td>
						<div>
							<span>
								<input type="radio"  name="invalid" value="0"/>&nbsp;{$lang.yes}
							</span>
							&nbsp;&nbsp;&nbsp;
							<span>
								<input type="radio" name="invalid" value="1"/>&nbsp;{$lang.no}
							</span>
							<b class="lovingtips" title=""></b>
						</div>
					</td>
				</tr>				
			</table>			
		</div>
		<div class="submit" style="text-align:center;">
			<input type="submit" " value="{$lang.submit_text}"/>
			<input type="hidden" name="id" value="{$catInfo.id}"/>
		</div>
	</form>		
</div>


<script type="text/javascript">
	//初始化radio,checkbox
	function initInput(name,value){
		if(typeof name== 'undefined') return ;
		if(typeof value== 'undefined') return ;
		var inputObj   =   document.getElementsByName(name);		
		for(var i = 0; inputObj.length; i ++ ){
			if(inputObj[i].value == value){
				inputObj[i].checked = true;
				break;
			}
		}		
	}
	//初始化表单元素
	function initSelect(id,idValue){
		if(typeof id== 'undefined') return ;
		if(typeof idValue== 'undefined') return ;
		//id => obj
		var selectObj   =   document.getElementById(id);
		for(var i = 0; i < selectObj.options.length; i ++){
			if (selectObj.options[i].value == idValue) {        
				selectObj.options[i].selected = true; 
				break;        
			}        
		}		
	}
	
	// 初始化input
	initInput('invalid',{$catInfo.invalid});
	// 初始化select
	initSelect('parent_id',{$catInfo.parent_id});
</script>










